home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1995 May / cd Ware (Juegos) Epimundo.iso / DOS / TOOLS / DEBUG7.ZIP / DEBUG7.LQR / DEBUG7.DOC next >
Encoding:
Text File  |  1985-01-21  |  5.0 KB  |  107 lines

  1.                DEBUG87 PATCH FOR IBM DEBUG VER 2.X
  2.  
  3.                           By Bill Janes     
  4.  
  5. This is a patch to the IBM Debug 2.0 or 2.1 utility that helps in 
  6. the debugging of 8087 assembly language programs by adding a 
  7. command to debug that causes the contents of 8087 stack registers 
  8. to be displayed on the screen.  The contents of the 8087 stack 
  9. are displayed using the Intel floating point to ASCII conversion 
  10. routine that is in their Application Note AP-113 (ref 1).  
  11. Integer numbers are displayed as such, and nonintegral numbers 
  12. are displayed in exponential format.  A resister that is empty, 
  13. NAN, indefinite, or infinity is so labeled.  The flags in the 
  14. control word and the status word are also shown, along with the 
  15. next instruction to be executed (as with the debug R command).  
  16. The abbreviations for these flags is that used in the Intel 
  17. Numerics Supplement.  For more details, refer to in references 2 
  18. and 3.  
  19.  
  20. ADDING THE PATCH
  21.  
  22. The necessary files to carry out the patch are PATCH4.BIN, 
  23. DEBUG7.PAT, DEBUG.COM.  The first two are in the library, and you 
  24. must supply debug.com since it is not in the public domain.  
  25. First make certain that you have the IBM version 2.0 or 2.1 of 
  26. debug that comes with like versions of DOS.  Debug is the same in 
  27. both versions, but the debug supplied with DOS 3.0 is different 
  28. and can't be used.  The debug supplied with the Microsoft Macro 
  29. assemabler 1.27 also appears to be different, and should not be 
  30. used.  The original version of debug, without any patches should 
  31. be used.  Adding the patch to DEBUG.COM is very easy, but 
  32. requires that you are running under DOS 2.0 or above.  Make sure 
  33. that the following files are all in the current directory: 
  34. debug.com (your original version), patch.bin (which contains the 
  35. code for the patch) and debug7.pat (which serves an an input file 
  36. for debug in carrying out the patch).  Then type at the command 
  37. line: DEBUG < DEBUG7.PAT.  This activates debug which uses the 
  38. redirection feature of DOS 2.0 and performs the patch according 
  39. to the instructions in debug7.pat and writes the patched program 
  40. to disk as DEBUG87.COM.  This patch also corrects a bug in the 
  41. original debug program that occasionally locks up the program; 
  42. this second patch was suggested by Stephen Baumgartner (ref. 3).  
  43. I have used it for a year with no problems.  For details about 
  44. the lockup problem and its correction see references 4 and 5.  
  45.  
  46. USING THE DEBUG87
  47.  
  48. To use the patched program, simply type P from the debug command
  49. line, for numeric Processr.  The choice of letters is quite 
  50. limited; most of the 26 letters of the alphabet are already in
  51. use (Debug 3.0 uses the P command for another purpose).  The
  52. 8087 stack registers are displayed along with the control flags
  53. and status flags.  The abbreviations for the flags is that in the
  54. Intel literature and is in references 2 and 3, which also explain
  55. their significance. 
  56.  
  57. TESTING THE PATCH
  58.  
  59. The patch may be tested and its use illustrated by using DEBUG87 
  60. with the short program TEST.COM which is included in the library 
  61. along with its assembly listing.  At the dos command level type 
  62. in DEBUG87 TEST.COM.  Debug87 will load the test program and 
  63. display the debug prompt in the usual fashion.  Then type in G 
  64. 13E and then P. Your output should be similar to what is shown 
  65. below.  If not, something must be wrong; perhaps your version of 
  66. Debug is different from mine.  If everythink seems OK, further 
  67. testing may by done by single stepping through the program and 
  68. displaying the 8087 status ofter each instruction.  The FXAM 
  69. instructions are included to check the condition flags.
  70.  
  71.  
  72. debug87 test.com
  73. -G 13E
  74. X=0000  BX=0000  CX=0055  DX=0000  SP=FFFE  BP=0000  SI=0000  DI=0000  
  75. DS=1065  ES=1065  SS=1065  CS=1065  IP=013E   NV UP DI PL NZ NA PO NC 
  76. 1065:013E 9B            WAIT                                       
  77. -P
  78. T(0) +0                       ST(1) -3.14159265358979        
  79. ST(2) +1.23456700000000E+103   ST(3) +1234                    
  80. ST(4) +INFINITY                ST(5) INDEFINITE               
  81. ST(6) +NAN                     ST(7) EMPTY                    
  82. CONTROL IC=0 RC=00 PC=11 IEM=1 PM=1 UM=1 0M=1 ZM=1 DM=1 IM=1
  83. STATUS  B=0 C3=0 ST=1 C2=0 C1=0 C0=1 IR=0 PE=0 UE=0 OE=0 ZE=1 DE=0 IE=1
  84. 1065:013E 9B            WAIT                                       
  85. -Q
  86.  
  87. References:
  88.  
  89. 1. Getting Started with the Numeric Data Processor, AP-113, 
  90.    Intel Corporation, 1981.
  91.  
  92. 2. IAPX 86/20, 88/20 Numerics Supplement, in iAPX 86, 88 User's 
  93.    Manual, Intel Corp 1981.
  94.  
  95. 3. Startz, Richard: 8087 Applications and Programming for the IBM PC.
  96.    Brady Co., 1983
  97.  
  98. 4. Baumgartner, Stephen: in User to User column, PC Magaine, 
  99.    2:653-654, 1983 (December 83).
  100.  
  101. 5. Smith, Bob and Puckett, Tom:  Time on your Hands.  A patch 
  102.    to Debug.com.  PC Tech Journal 1:146-161, 1984 (May).
  103.  
  104. Please send any comments or suggestions to me via Compuserve.    
  105. Bill Janes  74166,2572
  106.  
  107.